package com.tywj.terminalapp.utils;

import android.content.Context;
import android.content.SharedPreferences;

import com.tywj.terminalapp.Config;


public class SPUtils {

    public static void rememberUser(Context context, String phone){
        SharedPreferences setting = context.getSharedPreferences(Config.STRING_INFO,0);
        setting.edit().putString(Config.USER_PHONE,phone).commit();
    }

    public static String getUser(Context context){
        SharedPreferences setting = context.getSharedPreferences(Config.STRING_INFO,0);
        String phone = setting.getString(Config.USER_PHONE,"");
        return phone;
    }

    public static String clearUser(Context context){
        SharedPreferences sp = context.getSharedPreferences(Config.STRING_INFO,
                Context.MODE_PRIVATE);
        sp.edit().putString(Config.USER_PHONE,null)
                .commit();
        return null;
    }


}
